﻿// See https://aka.ms/new-console-template for more information
class b2
{
    public static void Main(string[] args)
    {
        int[] arr;
        int max,min,sum=0;
        double arv;
        Console.WriteLine("输入数组长度：");
        int n=Int32.Parse(Console.ReadLine());
        Console.WriteLine("输入数组元素(整型)：");
        arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = Int32.Parse(Console.ReadLine());
        }
        max = arr[0];
        min = arr[0];
        for(int i = 0; i < n; i++)
        {
            if(arr[i] > max)
                max = arr[i]; 
            if(arr[i] < min)
                min = arr[i];
            sum+=arr[i];
        }
        arv = sum * 1.0 / arr.Length;
        Console.WriteLine("最大值：" + max);
        Console.WriteLine("最小值：" + min);
        Console.WriteLine("总和：" + sum);
        Console.WriteLine("平均值" + arv);
    }
    
}
